<form name="contractEditProductForm" class="form-horizontal" novalidate style="width:500px;">
    <div class="form-group mt10 clearfix" ng-if="isEdit">
        <span class="col-sm-6 control-label">
            状态
        </span>
        <span class="col-sm-6 control-label" ng-class="data.status === '超额' ? 'c-red' : ''">
            {{data.status}}
        </span>
        <span class="col-sm-6 control-label">
            已出数目
        </span>
        <span class="col-sm-6 control-label">
            {{data.alreadyOutNum}}
        </span>
    </div>
    <div class="form-group mt10 clearfix">
        <span class="col-sm-6 control-label">产品名称</span>

        <div class="col-sm-18">
            <input class="form-control" ng-if="readOnly" disabled ng-value="data.application_name"/>
            <input select2 required ng-model="data.application_id" name="application_id" ng-if="!readOnly" select2-model="ddl2Project" config="ddlConfigProjects"
                class="form-control" type="text" placeholder="产品名称" />
            <span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.application_id.$touched) && contractEditProductForm.application_id.$error.required"
                class="error ng-hide c-red lh30">请选择产品名称</span>
        </div>
    </div>
    <div class="form-group mt10 clearfix" ng-if="data.application_id=='other'">
        <span class="col-sm-6 control-label">产品明细</span>

        <div class="col-sm-18">
            <input select2 required ng-model="data.other_application_id" ng-disabled="readOnly" name="other_application_id" select2-model="ddl2OtherProject"
                config="ddlConfigOtherProjects" class="form-control" type="text" placeholder="产品明细" />
            <span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.other_application_id.$touched) && contractEditProductForm.other_application_id.$error.required"
                class="error ng-hide c-red lh30">请选择产品明细</span>
        </div>
    </div>

    <div class="form-group mt10 clearfix" ng-if="(data.authorization_type==0 || data.authorization_type==1) && data.is_simple!=1">
        <span class="col-sm-6 control-label">标准单价</span>

        <div class="col-sm-18" ng-if="data.authorization_type==0 && data.application_id!='other'">
            <input type="number" ng-disabled="true" ng-model="data.price" class="form-control" id="inputPrice" placeholder="标准单价">
        </div>
        <div class="col-sm-18" ng-if="data.authorization_type==0 && data.application_id=='other'">
            <input type="number" ng-model="data.price" ng-disabled="readOnly" class="form-control" id="inputPrice" placeholder="标准单价">
        </div>
        <div class="col-sm-18" ng-if="data.authorization_type==1">
            <input select2 ng-model="data.price" ng-disabled="readOnly" required name="price" select2-model="ddl2SMSPrice" config="ddlConfigSMSPrice" class="form-control"
                type="text" placeholder="标准单价" />
            <span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.price.$touched) && contractEditProductForm.price.$error.required"
                class="error ng-hide c-red lh30">标准单价不能为空</span>
        </div>
    </div>
    <div class="form-group mt10 clearfix" ng-if="data.authorization_type==0 && data.is_simple!=1">
        <span class="col-sm-6 control-label">产品数</span>

        <div class="col-sm-18">
            <input type="number" ng-model="data.authorization_numeric" ng-disabled="readOnly" required number min="1" name="authorization_numeric" class="form-control"
                id="inputNumber" placeholder="产品数">
            <span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.authorization_numeric.$touched) && contractEditProductForm.authorization_numeric.$error.required"
                class="error ng-hide c-red lh30">产品数不能为空</span>
            <span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.authorization_numeric.$touched) && contractEditProductForm.authorization_numeric.$error.number"
                class="error ng-hide c-red lh30">产品数必须是数值类型</span>
            <span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.authorization_numeric.$touched) && contractEditProductForm.authorization_numeric.$error.min"
                class="error ng-hide c-red lh30">产品数必须大于0</span>
        </div>
    </div>

    <div class="form-group mt10 clearfix" ng-if="data.authorization_type==0 && data.is_simple!=1">
        <span class="col-sm-6 control-label">租用周期(月)</span>

        <div class="col-sm-18">
            <input type="number" ng-disabled="readOnly" ng-model="data.rent_period" required number min="1" name="rent_period" class="form-control" id="inputPeriod"
                placeholder="租用周期(月)">
            <span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.rent_period.$touched) && contractEditProductForm.rent_period.$error.required"
                class="error ng-hide c-red lh30">租用周期不能为空</span>
            <span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.rent_period.$touched) && contractEditProductForm.rent_period.$error.number"
                class="error ng-hide c-red lh30">租用周期必须是数值类型</span>
            <span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.rent_period.$touched) && contractEditProductForm.rent_period.$error.min"
                class="error ng-hide c-red lh30">租用周期必须大于0</span>

        </div>
    </div>
    <div class="form-group mt10 clearfix" ng-if="data.authorization_type==1">
        <span class="col-sm-6 control-label">短信条数</span>

        <div class="col-sm-18">
            <input type="number" ng-disabled="readOnly" ng-model="data.authorization_numeric" required number min="1" name="authorization_numeric" class="form-control"
                id="inputSmsNumber" placeholder="短信条数">
            <span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.authorization_numeric.$touched) && contractEditProductForm.authorization_numeric.$error.required"
                class="error ng-hide c-red lh30">短信条数不能为空</span>
            <span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.authorization_numeric.$touched) && contractEditProductForm.authorization_numeric.$error.number"
                class="error ng-hide c-red lh30">短信条数必须是数值类型</span>
            <span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.authorization_numeric.$touched) && contractEditProductForm.authorization_numeric.$error.min"
                class="error ng-hide c-red lh30">短信条数必须大于0</span>
        </div>
    </div>
    <div class="form-group mt10 clearfix" ng-if="data.authorization_type==1 || data.authorization_type==0">
        <span class="col-sm-6 control-label">合同属性</span>
        <div class="col-sm-18">
            <input select2 ng-model="data.contract_type" ng-disabled="readOnly" required name="contract_type" select2-model="ddl2ContractType" config="ddlConfigContractType"
                class="form-control" type="text" placeholder="合同属性" />
            <span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.contract_type.$touched) && contractEditProductForm.contract_type.$error.required"
                class="error ng-hide c-red lh30">合同属性不能为空</span>
        </div>
    </div>
    <div class="form-group mt10 clearfix">
        <span class="col-sm-6 control-label">标准金额</span>

        <div class="col-sm-18">
            <input type="number" required number min="0" ng-model="data.amount" name="amount" class="form-control" id="inputAmount" ng-disabled="readOnly || (data.authorization_type==0 || data.price==0) && data.is_simple!=1"
                placeholder="标准金额" />

            <span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.amount.$touched) && contractEditProductForm.amount.$error.required"
                class="error ng-hide c-red lh30">标准金额不能为空</span>
            <span role="alert" ng-show=" contractEditProductForm.amount.$error.number" class="error ng-hide c-red lh30">标准金额必须是数值类型</span>
            <span role="alert" ng-show=" contractEditProductForm.amount.$error.min" class="error ng-hide c-red lh30">标准金额必须大于等于0</span>
        </div>
    </div>
    <!--<div class="form-group mt10 clearfix">-->
        <!--<span class="col-sm-6 control-label">结算基准价</span>-->

        <!--<div class="col-sm-18">-->
            <!--<input type="number" required number min="0" ng-model="data.benchmark_amount" name="benchmark_amount" class="form-control" id="inputBenchmarkAmount"-->
                <!--placeholder="结算基准价" />-->

            <!--<span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.benchmark_amount.$touched) && contractEditProductForm.benchmark_amount.$error.required"-->
                <!--class="error ng-hide c-red lh30">结算基准价不能为空</span>-->
            <!--<span role="alert" ng-show=" contractEditProductForm.benchmark_amount.$error.number" class="error ng-hide c-red lh30">结算基准价必须是数值类型</span>-->
            <!--<span role="alert" ng-show=" contractEditProductForm.benchmark_amount.$error.min" class="error ng-hide c-red lh30">结算基准价必须大于等于0</span>-->
        <!--</div>-->
    <!--</div>-->
    <!--<div class="form-group mt10 clearfix">-->
        <!--<span class="col-sm-6 control-label">结算类型</span>-->
        <!--<div class="col-sm-18">-->
            <!--<input select2 ng-model="data.settlement_type" ng-disabled="readOnly" required name="settlement_type" select2-model="ddl2SettlementType" config="ddlConfigSettlementType"-->
                <!--class="form-control" type="text" placeholder="结算类型" />-->
            <!--<span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.settlement_type.$touched) && contractEditProductForm.settlement_type.$error.required"-->
                <!--class="error ng-hide c-red lh30">结算类型不能为空</span>-->
        <!--</div>-->
    <!--</div>-->
    <!--<div class="form-group mt10 clearfix">-->
        <!--<span class="col-sm-6 control-label">结算比例(%)</span>-->
        <!--<div class="col-sm-18">-->
            <!--<input type="number" required number min="0" ng-disabled="readOnly" ng-model="data.settlement_scale" name="settlement_scale" class="form-control"-->
                <!--placeholder="结算比例" />-->
            <!--<span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.settlement_scale.$touched) && contractEditProductForm.settlement_scale.$error.required"-->
                <!--class="error ng-hide c-red lh30">结算比例不能为空</span>-->
            <!--<span role="alert" ng-show=" contractEditProductForm.settlement_scale.$error.number" class="error ng-hide c-red lh30">结算比例必须是数值类型</span>-->
            <!--<span role="alert" ng-show=" contractEditProductForm.settlement_scale.$error.min" class="error ng-hide c-red lh30">结算比例必须大于等于0</span>-->
        <!--</div>-->
    <!--</div>-->
    <!--<div class="form-group mt10 clearfix">-->
        <!--<span class="col-sm-6 control-label" ng-if="data.settlement_type==2">折扣(%)</span>-->
        <!--<div class="col-sm-18" ng-if="data.settlement_type==2">-->
            <!--<input type="number" required number min="0" ng-disabled="readOnly" ng-model="data.discount" name="discount" class="form-control" placeholder="折扣"-->
            <!--/>-->
            <!--<span role="alert" ng-show="(contractEditProductForm.$submitted || contractEditProductForm.discount.$touched) && contractEditProductForm.discount.$error.required"-->
                <!--class="error ng-hide c-red lh30">折扣不能为空</span>-->
            <!--<span role="alert" ng-show=" contractEditProductForm.discount.$error.number" class="error ng-hide c-red lh30">折扣必须是数值类型</span>-->
            <!--<span role="alert" ng-show=" contractEditProductForm.discount.$error.min" class="error ng-hide c-red lh30">折扣必须大于等于0</span>-->
        <!--</div>-->
    <!--</div>-->

    <div class="ui-dialog-footer mt40" style="padding-bottom: 0">
        <div class="ui-dialog-button" style="padding-bottom: 0">
            <button class="ui-dialog-autofocus" ng-click="onResolve()" ng-disabled="contractEditProductForm.$invalid">确定</button>
            <button ng-click="onReject()">取消</button>
        </div>
    </div>
</form>